﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Joy.Erp.BasicArchives.Core.Filters;

namespace Joy.Erp.BasicArchives.Sales
{
    public interface ISaleOrderAppService
    {
        Task<SaleOrderDto> GetAsync(Guid id);
        Task<SaleOrderLineDto> GetChildAsync(Guid id);
        Task<SaleOrderDto> FindAsync(string filter);
        Task<SaleOrderDto> FindBySourceKeyAsync(string sourceKey, string sourceType);
        Task<PagedResultDto<SaleOrderDto>> GetListAsync(FilterRequestDto input);
        Task<PagedResultDto<SaleOrderDto>> QueryAsync(FilterGroupRequestDto input);
        Task<PagedResultDto<SaleOrderLineDto>> QueryChildrenAsync(FilterGroupRequestDto input);
        Task<SaleOrderDto> CreateAsync(SaleOrderCreateDto input);
        Task<SaleOrderDto> UpdateAsync(Guid id, SaleOrderUpdateDto input);
        Task<SaleOrderDto> SubmitAsync(Guid id);
        Task<SaleOrderDto> ApproveAsync(Guid id);
        Task<SaleOrderDto> UnApproveAsync(Guid id);
        Task DeleteAsync(Guid id);
        Task<List<SaleOrderDto>> BatchCreateAsync(List<SaleOrderCreateDto> inputs, bool useBulk = false);
        Task<List<SaleOrderDto>> BatchUpdateAsync(List<SaleOrderBatchUpdateDto> inputs, bool useBulk = false);
        Task BatchDeleteAsync(List<Guid> ids, bool useBulk = false);
    }
}